<div class="footer">
    <div class="join">
        <div class="title">申请加盟</div>
        <div class="box">
            <div class="input_box f_l">
                <div class="iput">
                    <span class="inp w2 f_l"><input placeholder="姓名" id="name"></span>
                    <span class="inp w2 f_r"><input placeholder="手机号码" id="mobile"></span>
                </div>
                <div class="iput">
                    <span class="inp w2 f_l"><input placeholder="Email" id="mail"></span>
                    <span class="inp w2 f_r"><input placeholder="地址" id="address"></span>
                </div>
                <div class="iput">
                	<span class="tex">
                    	<textarea placeholder="加盟说明" id="content"></textarea>
                    </span>
                </div>
                <div class="iput">
                    <span class="inp w2"><input value="确定提交" type="button" id="subscribe"></span>
                </div>
            </div>
            <div class="con f_r">
                <img src="<?php echo image_url('foot_logo.png'); ?>">
                <b><?php echo $this->config->item('telephone'); ?></b>
                <p>地址：<?php echo $this->config->item('address'); ?></p>
                <em>质量是我们企业的生命，信誉是我们恪守的宗旨</em>
            </div>
        </div>
    </div>
    <div class="copyright">
        <p>西雅图墙布 &copy; 版权所有 2020-2021 <a href="#"><?php echo $this->config->item('company_no'); ?></a></p>
        <p>
            <em>公司地址：<?php echo $this->config->item('address'); ?></em>
            <em>电话：<?php echo $this->config->item('telephone'); ?></em>
            <em>传真：<?php echo $this->config->item('chuanzhen'); ?></em>
        </p>
    </div>
</div>
<script>
    $(function () {
        // $("#subscribe").click(function () {
        $(document).on("click", "#subscribe", function () {
            var mobile = $("#mobile").val();
            var address = $("#address").val();
            var content = $("#content").val();
            var name = $("#name").val();
            var myreg = /^((\d{3}-\d{8}|\d{4}-\d{7,8})|(1[3|5|7|8][0-9]{9}))$/;
            if (mobile == "") {
                layer.msg('请填写手机号码');
                return false;
            }
            if (name == "") {
                layer.msg('请填写好友称呼');
                return false;
            }
            if (!myreg.test(mobile)) {
                layer.msg("手机号格式不正确");
                return false;
            }
            var email = $("#mail").val();
            var reg = /\w+[@]{1}\w+[.]\w+/;
            if (email == '' || email == undefined) {
                layer.alert("请输入email地址");
                return false;
            }
            if (!reg.test(email)) {
                layer.alert("请输入正确的email地址");
                return false;
            }
            var url = "/message";
            $.ajax({
                url: url,
                type: "post",
                data: {'name': name, 'mobile': mobile, 'address': address, 'email': email, 'content': content},
                dataType: 'json',
                success: function (data) {
                    console.log(data);
                    if (data.status == 1) {
                        layer.alert("申请成功", {
                            skin: 'layui-layer-lan'
                            , closeBtn: 1
                            , anim: 5 //动画类型
                        }, function (index) {
                            window.location.href = window.location.href;
                        });
                    } else {
                        layer.alert("订阅失败");
                    }
                }
            });

        });
    });
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationClickable: false,
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        parallax: true,
        loop: true,
        speed: 600,
    });

    var swiper1 = new Swiper(".swiper-container1", {
        slidesPerView: 'auto',
        centeredSlides: true,
        loop: true,
        loopedSlides: 5,
        autoplay: 2000,
        pagination: '.swiper-pagination1',
        paginationClickable: false,
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        parallax: true,
        speed: 600,
    })
</script>
<script>
    $(function () {

        $("#phone_nav").click(function () {
            $(".phone_lis").toggle();
        });
    });
</script>
</body>
</html>